<!DOCTYPE html>
<html lang="en">
<head>
	<title>{:C('WEB_SITE_TITLE')}</title>
	<link href="__STATIC__/bootstrap/css/bootstrap.css" rel="stylesheet">
	<link href="__STATIC__/bootstrap/css/bootstrap-responsive.css" rel="stylesheet">
	<link href="__STATIC__/bootstrap/css/docs.css" rel="stylesheet">
	<link href="__STATIC__/bootstrap/css/onethink.css" rel="stylesheet">
	<link rel="stylesheet" type="text/css" href="__STATIC__/bootstrap/css//base.css" media="all">
    <link rel="stylesheet" type="text/css" href="__STATIC__/bootstrap/css/common.css" media="all">
    <link rel="stylesheet" type="text/css" href="__STATIC__/bootstrap/css/module.css">
    <link rel="stylesheet" type="text/css" href="__CSS__/my.css">

    <!-- <link rel="stylesheet" type="text/css" href="__STATIC__/bootstrap/css//style.css" media="all"> -->
    <!-- <link rel="stylesheet" type="text/css" href="__STATIC__/bootstrap/css//my.css" media="all"> -->
	<!-- <link rel="stylesheet" type="text/css" href="__STATIC__/bootstrap/css//{$Think.config.COLOR_STYLE}.css" media="all"> -->
	<!-- Le HTML5 shim, for IE6-8 support of HTML5 elements -->
	<!--[if lt IE 9]>
	<script src="__STATIC__/bootstrap/js/html5shiv.js"></script>
	<![endif]-->
	<block name="style"></block>
	<link rel="stylesheet" type="text/css" href="__CSS__/main.css">
	<!--[if lt IE 9]>
	<script type="text/javascript" src="__STATIC__/jquery-1.10.2.min.js"></script>
	<![endif]-->
	<!--[if gte IE 9]><!-->
	<!-- <script type="text/javascript" src="__STATIC__/jquery-2.0.3.min.js"></script>
	<script type="text/javascript" src="__STATIC__/bootstrap/js/bootstrap.min.js"></script> -->
	<script src="__STATIC__/bootstrap/js/jquery-1.11.3.js"></script>
	<script src="__STATIC__/bootstrap/js/index.js" type="text/javascript"></script>
	<script src="__STATIC__/bootstrap/js/frame.js" type="text/javascript"></script>
	

	<script type="text/javascript" src="__STATIC__/jquery-2.0.3.min.js"></script>
    <script type="text/javascript" src="__JS__/jquery.mousewheel.js"></script>
    <script type="text/javascript" src="__STATIC__/uploadify/jquery.uploadify.min.js"></script>
    <script src="__JS__/tishi.js" type="text/javascript"></script>
	
	<link href="__CSS__/normalize.css" rel="stylesheet" type="text/css">
	<link rel="stylesheet" href="__CSS__/animate.min.css">
	<link rel="stylesheet" href="__CSS__/jquery.gDialog.css">
	<script src="__JS__/jquery.gDialog.js"></script>
	
	</head>
<body>
	
	<include file="Public/header" />
	<!--未定义-->
	
	<div class="clear"></div>
	<div class="nav" id="main">
		<!-- <?php if(!empty($_SESSION['gmid'])){unset($_SESSION['gmid']);}?> -->
		<!-- left -->
		<include file="Public/left" />
        

        <!-- left end -->
        <div id="main_show">
      		<p id="web_gg">公告：欢迎您进入优快推推广平台。企业要推广，就用优快推<span>优快推1.0</span></p> 

      		<h3 class="main_h3">友情链接</h3>
      		<a href="{:U('Main/links',array('cid'=>$cid))}" class="btn-success">添加</a>
      		<hr>
			<div class="xinxi">
		       <table class="table  table-striped">
			       	<tr>
			       		<th>ID</th>
			       		<th>网站名称</th>
			       		<th>网络链接</th>
			       		<th>网站排序</th>
			       		<th>网站描述</th>
			       		<th>操作</th>
			       	</tr>
			       	<notempty name="list">
					<volist name="list" id="v">
				       	<tr>
				       		<td>{$v.id}</td>
				       		<td>{$v.name}</td>
				       		<td>{$v.href}</td>
				       		<td>{$v.sort}</td>
				       		<td>{$v.detail}</td>
				       		<td>
				       			<a href="{:U('Main/edit',array('id'=>$v['id']))}">编辑</a>
				       			<a href="#" data_url="{:U('Main/delt')}" onclick="return del(this)" pid="{$v.id}" >删除</a>
				       		</td>
				       	</tr>
					</volist>
					<else/>
						<td colspan="12" class="text-center"> aOh! 暂时还没有内容!<a href="{:U('Main/links')}">点击这里去添加...</a> </td>
					</notempty>
		       </table>
		       
		       <script type='text/javascript'>
			       function del(obj){
			       	var url = $(obj).attr('data_url');
			       	var id = $(obj).attr('pid');
			       	// console.log(url);
			       	// console.log(id);
			       	$.ajax({
			       		type:'post',
			       		url:url,
			       		data:'id='+id,
			       		dataType:'json',
			       		success:function(data){
			       				if(data['status']){
			       					$.gDialog.confirm("Are You Sure?-------------亲^_^-删除成功", {
									    title: "企优托提醒您：",
										animateIn : "rollIn",
									    animateOut: "rollOut"
								  	});
					    			// document.location.reload();
					    			$(obj).parent().parent().remove();
			       				}else{
			       					$.gDialog.confirm("Are You Sure?-------------亲/(ㄒoㄒ)/~~-删除失败", {
									    title: "企优托提醒您：",
										animateIn : "rollIn",
									    animateOut: "rollOut"
								  	});
			       				}
				       		}
			       		})

			        }


						
				$(document).ready(function(){
					var src = $(".img1");
		            $('.img1').each(function(i){
		                var img = $(this).children('img').attr('src');
		                // alert(img);
		                if(img == false){
		                    $(this).children('img').remove();
		                    $(this).children('a').show();
		                }else{
		                    $(this).children('a').remove();
		                }

		            });
				});

			</script>
		       <div class="page">{$page}</div>
	       </div>
        </div>
	
					<div id='div'>
						<!-- <link rel="stylesheet" type="text/css" href="__CSS__/common.css"> -->
					    <script type="text/javascript" src="__STATIC__/uploadify/jquery.uploadify.min.js"></script>
					    <div class="main_title">
					        <h2>添加图片</h2>
					    </div>

					    <!-- <form action="{:U()}" method="post" class="form-horizontal"> -->
					        <div class="controls">
					            <!-- <label class="item-label">产品图标</label> -->
					            <input type="file" id="upload_picture">
					         	<div class="upload-img-box">
					            <notempty name="info['icon']">
					                <div class="upload-pre-item"><img src="{$info.icon|get_cover='path'}"/></div>
					            </notempty>
					            </div>
					            <a class="btn-up" href="__MODULE__/Pro/index">确定</a>
					        </div>

					        <script type="text/javascript">
					        //上传图片
					        /* 初始化上传插件 */
					        $("#upload_picture").uploadify({
					            "height"          : 30,
					            "swf"             : "__STATIC__/uploadify/uploadify.swf",
					            "fileObjName"     : "download",
					            "buttonText"      : "上传图片",
					            "uploader"        : "{:U('Product/uploadPicture',array('session_id'=>session_id()))}",
					            "width"           : 120,
					            'removeTimeout'   : 1,
					            'fileTypeExts'    : '*.jpg; *.png; *.gif;',
					            "onUploadSuccess" : uploadPicture,
					            'onFallback' : function() {
					                alert('未检测到兼容版本的Flash.');
					            }
					        });
					        function uploadPicture(file, data){
					            var data = $.parseJSON(data);
					            var src = ' ';
					            if(data.status){
					                $("#icon").val(data.id);
					                src = data.url || data.path;
					                // $("#icon").parent().find('.upload-img-box').html(
					                //     '<div class="upload-pre-item"><img src="' + src + '"/></div>'
					                // );
					            } else {
					                updateAlert(data.info);
					                setTimeout(function(){
					                    $('#top-alert').find('button').click();
					                    $(that).removeClass('disabled').prop('disabled',false);
					                },1500);
					            }
					        }
					    </script>
				</div>

				<style type="text/css">
					#div{
						display: none;
						position: absolute;
						top:50%;
					 
						left: 50%;
						margin-left: -245px;
						margin-top: -25px;
						width: 25%;
						height: 70%;
						background-color:rgb(254,248,208);
					}
					#div .btn{
						position: inline-block;
						padding: 5px 25px;
						width: 120px;
						height: 30px;
						color: #fff;
						background-color: rgb(39,174,96);
						line-height: 30px;
						text-align: center;
						border-radius: 3px;
						margin-left: 72px;
					}
					.main_title h2{text-align: center;}
					.main_title h2 b{display: block; float: right; cursor: pointer;}
					#upload_picture{margin:50px auto;}
				</style>




	</div>
<block name="script">
	
</block>

</body>
</html>